package com.umeng.analytics.pro;

import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.Collections;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class bl implements cg, Serializable, Cloneable {
    static class a extends dp {
        private a() {

        }

        public void a(df arg5, bl arg6) throws cm {
            arg5.j();
            while(true) {
                da v0 = arg5.l();
                if(v0.b == 0) {
                    break;
                }

                switch(v0.c) {
                    case 1: {
                        if(v0.b == 11) {
                            arg6.a = arg5.z();
                            arg6.a(true);
                            break;
                        }

                        di.a(arg5, v0.b);
                        break;
                    }
                    case 2: {
                        if(v0.b == 10) {
                            arg6.b = arg5.x();
                            arg6.b(true);
                            break;
                        }

                        di.a(arg5, v0.b);
                        break;
                    }
                    case 3: {
                        if(v0.b == 8) {
                            arg6.c = arg5.w();
                            arg6.c(true);
                            break;
                        }

                        di.a(arg5, v0.b);
                        break;
                    }
                    default: {
                        di.a(arg5, v0.b);
                        break;
                    }
                }

            label_9:
                arg5.m();
            }

            arg5.k();
            if(!arg6.h()) {
                throw new dg("Required field \'ts\' was not found in serialized data! Struct: " + this.toString());
            }

            if(!arg6.k()) {
                throw new dg("Required field \'version\' was not found in serialized data! Struct: " + this.toString());
            }

            arg6.l();
        }

        public void a(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bl)arg2));
        }

        public void b(df arg3, bl arg4) throws cm {
            arg4.l();
            arg3.a(bl.m());
            if(arg4.a != null) {
                arg3.a(bl.n());
                arg3.a(arg4.a);
                arg3.c();
            }

            arg3.a(bl.o());
            arg3.a(arg4.b);
            arg3.c();
            arg3.a(bl.q());
            arg3.a(arg4.c);
            arg3.c();
            arg3.d();
            arg3.b();
        }

        public void b(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bl)arg2));
        }
    }

    static class b implements do0 {

        private b() {

        }

        public a a() {
            return new a();
        }

        public dn b() {
            return this.a();
        }
    }

    static class c extends dq {
        private c() {

        }

        public void a(df arg3, bl arg4) throws cm {
            ((dl)arg3).a(arg4.a);
            ((dl)arg3).a(arg4.b);
            ((dl)arg3).a(arg4.c);
        }

        public void a(df arg1, cg arg2) throws cm {
            this.a(arg1, ((bl)arg2));
        }

        public void b(df arg4, bl arg5) throws cm {
            arg5.a = ((dl)arg4).z();
            arg5.a(true);
            arg5.b = ((dl)arg4).x();
            arg5.b(true);
            arg5.c = ((dl)arg4).w();
            arg5.c(true);
        }

        public void b(df arg1, cg arg2) throws cm {
            this.b(arg1, ((bl)arg2));
        }
    }

    static class d implements do0 {

        private d() {

        }

        public c a() {
            return new c();
        }

        public dn b() {
            return this.a();
        }
    }

    public enum bl$e implements cn {
        IDENTITY((short)1, "identity"),
        TS((short)2, "ts"),
        VERSION((short)3, "version");

        private static final Map<String, bl$e> d;
        private final short e;
        private final String f;

        static {
            d = new HashMap();
            Iterator it = EnumSet.allOf(bl$e.class).iterator();
            while (it.hasNext()) {
                bl$e eVar = (bl$e) it.next();
                d.put(eVar.b(), eVar);
            }
        }

        private bl$e(short s, String str) {
            this.e = s;
            this.f = str;
        }

        public static bl$e a(int i) {
            switch (i) {
                case 1:
                    return IDENTITY;
                case 2:
                    return TS;
                case 3:
                    return VERSION;
                default:
                    return null;
            }
        }

        public static bl$e a(String str) {
            return d.get(str);
        }

        public static bl$e b(int i) {
            bl$e a = a(i);
            if (a != null) {
                return a;
            }
            throw new IllegalArgumentException("Field " + i + " doesn't exist!");
        }

        public final short a() {
            return this.e;
        }

        public final String b() {
            return this.f;
        }
    }


    public String a;
    public long b;
    public int c;
    public static final Map<e, cs> d;
    private static final long e = -6496538196005191531L;
    private static final dk f;
    private static final da g;
    private static final da h;
    private static final da i;
    private static final Map<Class<? extends dn>, do0> j;
    private static final int k = 0;
    private static final int l = 1;
    private byte m;

    static {
        f = new dk("IdSnapshot");
        g = new da("identity", (byte)11, (short) 1);
        h = new da("ts", (byte)10, (short) 2);
        i = new da("version", (byte)8, (short) 3);
        HashMap v0 = new HashMap();
        j = ((Map)v0);
        ((Map)v0).put(dp.class, new b());
        j.put(dq.class, new d());
        EnumMap v0_1 = new EnumMap(e.class);
        ((Map)v0_1).put(bl$e.IDENTITY, new cs("identity", (byte) 1, new ct((byte) 11)));
        ((Map)v0_1).put(bl$e.TS, new cs("ts", (byte) 1, new ct((byte) 10)));
        ((Map)v0_1).put(bl$e.VERSION, new cs("version", (byte) 1, new ct((byte) 8)));
        d = Collections.unmodifiableMap(((Map)v0_1));
        cs.a(bl.class, bl.d);
    }

    public bl() {
        this.m = 0;
    }

    public bl(bl arg3) {

        this.m = 0;
        this.m = arg3.m;
        if(arg3.e()) {
            this.a = arg3.a;
        }

        this.b = arg3.b;
        this.c = arg3.c;
    }

    public bl(String arg3, long arg4, int arg6) {
        this();
        this.a = arg3;
        this.b = arg4;
        this.b(true);
        this.c = arg6;
        this.c(true);
    }

    public bl a(String arg1) {
        this.a = arg1;
        return this;
    }

    public bl a(long arg2) {
        this.b = arg2;
        this.b(true);
        return this;
    }

    public bl a(int arg2) {
        this.c = arg2;
        this.c(true);
        return this;
    }

    private void a(ObjectInputStream arg3) throws IOException, ClassNotFoundException {
        try {
            this.m = 0;
            this.a(new cz(new dr(((InputStream)arg3))));
            return;
        }
        catch(cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public void a(df arg3) throws cm {
        bl.j.get(arg3.D()).b().b(arg3, ((cg)this));
    }

    private void a(ObjectOutputStream arg3) throws IOException {
        try {
            this.b(new cz(new dr(((OutputStream)arg3))));
            return;
        }
        catch(cm v0) {
            throw new IOException(v0.getMessage());
        }
    }

    public bl a() {
        return new bl(this);
    }

    public void a(boolean arg2) {
        if(!arg2) {
            this.a = null;
        }
    }

    public void b(boolean arg3) {
        this.m = cd.a(this.m, 0, arg3);
    }

    public void b(df arg3) throws cm {
        bl.j.get(arg3.D()).b().a(arg3, ((cg)this));
    }

    public cn b(int arg2) {
        return this.c(arg2);
    }

    public void b() {
        this.a = null;
        this.b(false);
        this.b = 0;
        this.c(false);
        this.c = 0;
    }

    public String c() {
        return this.a;
    }

    public void c(boolean arg3) {
        this.m = cd.a(this.m, 1, arg3);
    }

    public bl$e c(int arg2) {
        return bl$e.a(arg2);
    }

    public void d() {
        this.a = null;
    }

    public boolean e() {
        boolean v0 = this.a != null ? true : false;
        return v0;
    }

    public long f() {
        return this.b;
    }

    public void g() {
        this.m = cd.b(this.m, 0);
    }

    public boolean h() {
        return cd.a(this.m, 0);
    }

    public int i() {
        return this.c;
    }

    public void j() {
        this.m = cd.b(this.m, 1);
    }

    public boolean k() {
        return cd.a(this.m, 1);
    }

    public void l() throws cm {
        if(this.a == null) {
            throw new dg("Required field \'identity\' was not present! Struct: " + this.toString());
        }
    }

    static dk m() {
        return bl.f;
    }

    static da n() {
        return bl.g;
    }

    static da o() {
        return bl.h;
    }

    public cg p() {
        return this.a();
    }

    static da q() {
        return bl.i;
    }

    public String toString() {
        StringBuilder v0 = new StringBuilder("IdSnapshot(");
        v0.append("identity:");
        if(this.a == null) {
            v0.append("null");
        }
        else {
            v0.append(this.a);
        }

        v0.append(", ");
        v0.append("ts:");
        v0.append(this.b);
        v0.append(", ");
        v0.append("version:");
        v0.append(this.c);
        v0.append(")");
        return v0.toString();
    }
}

